function checkInput(){
	$('#Form1').submit(function(){
		var editor_words=$.trim($(CKEDITOR.instances.editor1.getData()).text());
		if($('#txtTitle').val()=='')	{
			Pui.manage.MsgDiv(1,"提示","标题不能为空！");
			return false;
		}
		if(CKEDITOR.instances.editor1.getData()=='' || editor_words==''){
			Pui.manage.MsgDiv(1,"提示","内容不能为空！");
			return false;
		}
		if(editor_words!='' && editor_words.length<100){
			Pui.manage.MsgDiv(1,"提示","内容字数不能少于100");
			return false;
		}
	});	
}
$(function(){checkInput();});
if ( window.CKEDITOR )
{
	(function()
	{
		var showCompatibilityMsg = function()
		{
			var env = CKEDITOR.env;

			var html = '<p><strong>你的浏览器不能够兼容这个文本编辑器！</strong>';

			var browsers =
			{
				gecko : 'Firefox 2.0',
				ie : 'Internet Explorer 6.0',
				opera : 'Opera 9.5',
				webkit : 'Safari 3.0'
			};

			var alsoBrowsers = '';

			for ( var key in env )
			{
				if ( browsers[ key ] )
				{
					if ( env[key] )
						html += ' CKEditor is compatible with ' + browsers[ key ] + ' or higher.';
					else
						alsoBrowsers += browsers[ key ] + '+, ';
				}
			}

			alsoBrowsers = alsoBrowsers.replace( /\+,([^,]+), $/, '+ and $1' );

			html += ' It is also compatible with ' + alsoBrowsers + '.';

			html += '</p><p>With non compatible browsers, you should still be able to see and edit the contents (HTML) in a plain text field.</p>';

			var alertsEl = document.getElementById( 'alerts' );
			alertsEl && ( alertsEl.innerHTML = html );
		};

		var onload = function()
		{
			// Show a friendly compatibility message as soon as the page is loaded,
			// for those browsers that are not compatible with CKEditor.
			if ( !CKEDITOR.env.isCompatible )
				showCompatibilityMsg();
		};

		// Register the onload listener.
		if ( window.addEventListener )
			window.addEventListener( 'load', onload, false );
		else if ( window.attachEvent )
			window.attachEvent( 'onload', onload );
	})();
}
